<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>elFinder</title>
    <!--
    <script type='text/javascript' src='http://getfirebug.com/releases/lite/1.2/firebug-lite-compressed.js'></script>
    -->
    <link rel="stylesheet" href="/{{=request.application}}/static/js/ui-themes/base/ui.all.css" type="text/css" media="screen" title="no title" charset="utf-8">
    <link rel="stylesheet" href="/{{=request.application}}/static/css/elfinder.css" type="text/css" media="screen" title="no title" charset="utf-8">

    <!--    
    <script src="js/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="js/jquery-ui-1.8b1.min.js" type="text/javascript" charset="utf-8"></script>
    -->

    <script src="/{{=request.application}}/static/jquery.js" type="text/javascript" charset="utf-8"></script>
    <script src="/{{=request.application}}/static/jquery-ui.js" type="text/javascript" charset="utf-8"></script>

    <script src="/{{=request.application}}/static/js/elfinder.min.js" type="text/javascript" charset="utf-8"></script>
    <!--
    <script src="js/i18n/elfinder.ru.js" type="text/javascript" charset="utf-8"></script>
    -->

    <style type="text/css">
        #close, #open, #dock, #undock {
            width: 100px;
            position:relative;
            display: -moz-inline-stack;
            display: inline-block;
            vertical-align: top;
            zoom: 1;
            *display: inline;
            margin:0 3px 3px 0;
            padding:1px 0;
            text-align:center;
            border:1px solid #ccc;
            background-color:#eee;
            margin:1em .5em;
            padding:.3em .7em;
            border-radius:5px; 
            -moz-border-radius:5px; 
            -webkit-border-radius:5px;
            cursor:pointer;
        }
    </style>

    

    <script type="text/javascript" charset="utf-8">
        $().ready(function() {
            
            var f = $('#finder').elfinder({
                url : 'http://{{=request.env["http_host"]}}/{{=request.application}}/default/web2py_elcon',
                lang : 'en',
				rememberLastDir: false,

                editorCallback : function(url) {
                    if (window.console && window.console.log) {
                        window.console.log(url);
                    } else {
                        alert(url);
                    }
                    
                },
				toolbar : [
				     ['back', 'reload'],
				     ['select', 'open'],
				     ['mkdir', 'mkfile', 'upload']
				],
				contextmenu : {
				      // Commands that can be executed for current directory
				      cwd : ['reload', 'delim', 'mkdir', 'mkfile', 'upload', 'delim', 'paste', 'delim', 'info'], 
				      // Commands for only one selected file
				      file : ['select', 'open', 'delim', 'copy', 'cut', 'rm', 'delim', 'duplicate', 'rename'], 
				      // Coommands for group of selected files
				      group : ['copy', 'cut', 'rm', 'delim', 'archive', 'extract', 'delim', 'info'] 
				    },
                closeOnEditorCallback : true,
                 docked : true,
                 dialog : {
                  title : 'File manager',
                  height : 500
                 }
            })
            // window.console.log(f)
            $('#close,#open,#dock,#undock').click(function() {
                $('#finder').elfinder($(this).attr('id'));
            })
            
        })
    </script>

</head>
<body>
    <div id="open">open</div><div id="close">close</div><div id="dock">dock</div><div id="undock">undock</div>
    <div id="finder">finder</div>

    


</body>
</html>
